using System;

namespace Lizk.SimpleHUD
{
    public class HUDAlphaList : HUDMoveList
    {
        public HUDAlphaList(SizeS itemSize, bool horizontal)
            : base(itemSize, horizontal)
        {

        }

        public override void Update(TimeSpan ts)
        {
            foreach (HUDControl control in controls)
            {
                RectangleS rect = RectangleS.Intersect(control.Bounds + Bounds.Location, Bounds);
                float s = ((rect.Width * rect.Height) / (itemSize.Height * itemSize.Width)) * 255;
                control.Alpha = (int)s;
            }
            base.Update(ts);
        }

    }
}
